home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5WPR008.TIP < prev    next >
Text File  |  1993-06-01  |  2KB  |  62 lines

  1. I've used Word for Windows for over two years and miss a
  2. feature found in most other word processors: File Delete.
  3. True, you can delete a file through the File·Find File
  4. command, but you first have to wait while WinWord searches
  5. the disk.
  6.  
  7. So I wrote a simple macro that deletes any file on any disk.
  8. After assigning it to the File menu (where God intended it
  9. to be), I can now select File·Delete (which I can do with
  10. the mouse or by pressing <Alt>-F, then D), and I'm prompted
  11. for a file name. If my macro can't find a file with that
  12. name, a dialog box tells me so.
  13.  
  14. Greg M. Perry
  15. Tulsa, Oklahoma
  16.  
  17. Editor's Note: To use this macro, start Word for Windows and
  18. use the Insert·File... command to import the text of the
  19. macro from the file P5WPR\WWDEL.TXT (found on your PowerBase
  20. *.* Volume 5 diskette) into a new Word for Windows document.
  21. Then copy the body of the macro to the clipboard, omitting
  22. the Sub Main statement at the top and the End Sub statement
  23. at the bottom. Next, select Tools·Macros, type DeleteFile as
  24. your macro name, and select Edit. Paste the macro text
  25. between the Sub and End Sub statements in the macro editing
  26. window. Finally, double click on the "go away" box in the
  27. upper left corner of the editing window and tell Word for
  28. Windows that you want to save the macro.
  29.  
  30. Next, put the macro on the File menu. Select Tools·Options,
  31. then press M to select the Menus category. Make sure the
  32. Menu box reads '&File'. Click on DeleteFile in the Macros
  33. list box and click Add. A Delete File item will appear at
  34. the bottom of the file menu. Click Close to exit.
  35.  
  36. This isn't a particularly complicated macro, but it is very
  37. useful and shows how you can add new commands to Word for
  38. Windows' menus. Unfortunately, Word for Windows' menu editor
  39. does have one awkward feature: You can add new items only at
  40. the bottom of the menu, so the new Delete File item winds up
  41. at the bottom instead of next to Find File, where you'd
  42. expect to find it.
  43.  
  44. The text of the macro is shown below.
  45.  
  46. ---- BEGIN LISTING ----
  47. Sub MAIN
  48. ' Delete a file from the disk
  49. Input "File to delete" ; fil$
  50. ' Erase the file
  51. If(len(fil$) > 0) Then Kill fil$
  52. End Sub
  53. ---- END LISTING ----
  54.  
  55.  
  56. Title: Word for Windows Does Deletions
  57. Category: WPR
  58. Issue Date: November, 1992
  59. Editor: Brett Glass
  60. Supplementary Files: P5WPR\WWDEL.TXT
  61. Filename: P5WPR008.TIP
  62.